home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 139
/
(Vol 139) Sep 24 2011.iso
/
Games
/
kirby.swf
/
scripts
/
DefineSprite_165
/
frame_1
/
PlaceObject2_143_1
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2011-09-24
|
2KB
|
56 lines
onClipEvent(enterFrame){
if(_root.Level[eval("../:Name")]._x + _root.Level._x >= - RandM && _root.Movwidth + RandM >= _root.Level[eval("../:Name")]._x + _root.Level._x && _root.Level[eval("../:Name")]._y + _root.Level._y >= - RandM && _root.Movheight + RandM >= _root.Level[eval("../:Name")]._y + _root.Level._y && _root.Kirby.AttackDemo == "off" && _root.Level[eval("../:Name")]._visible == 1 && eval("../:Name") != _root.Kirby.spiting)
{
Name = _root.Kirby.spiting.toLowerCase();
Name2 = eval("../:Name").toLowerCase();
if(this.Name != this.Name2)
{
_root.Level[eval("../:Name")]._y = StartY + 47 * Math.sin(0.017453292519943295 * rot);
}
rot += Speed * 2;
if(rot >= 360)
{
rot = 0;
}
_root.Level[eval("../:Name")]._x += X;
if(0 < X)
{
_root.Level[eval("../:Name")]._xscale = -100;
}
else
{
_root.Level[eval("../:Name")]._xscale = 100;
}
if(On != "off2")
{
On = "on";
}
}
else
{
if(On == "on" && _root.Level[eval("../:Name")]._visible == 0)
{
duplicateMovieClip(_root.Level.Puffeffect,"Peffect1",16584);
_root.Level.Peffect1._x = _root.Level[eval("../:Name")]._x;
_root.Level.Peffect1._y = _root.Level[eval("../:Name")]._y - 10;
}
On = "off";
if(- RandL >= StartX + _root.Level._x || StartX + _root.Level._x >= _root.Movwidth + RandL || - RandL >= StartY + _root.Level._y || StartY + _root.Level._y >= _root.Movheight + RandL)
{
_root.Level[eval("../:Name")]._visible = 1;
_root.Level[eval("../:Name")]._x = StartX;
_root.Level[eval("../:Name")]._y = StartY;
if(_root.Level[eval("../:Name")]._x + _root.Level._x < _root.Kirby._x)
{
_root.Level[eval("../:Name")]._xscale = -100;
X = Speed;
}
else
{
X = - Speed;
_root.Level[eval("../:Name")]._xscale = 100;
}
}
}
}